<template>
    <div class="rights">
        <div class="rights-box">
            <div class="rights-head">
                <img src="~assets/icons/rights2.png" alt="">
                <span>会员特权详情</span>
            </div>
            <p class="des-head">特权说明</p>
            <div class="rights-des" v-for="(item,index) in rights" :key="index">
                <div class="des-detail">
                    <div class="left">
                        <span>{{item.name}}</span>
                    </div>
                    <div class="right">
                        <span>{{item.content}}</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    name:'rights',
    data(){
        return {
            rights:[]
        }
    },
    methods:{
        getRights(){
            let that = this;
            let token = localStorage.getItem('token');
            let loader = that.loading();
            that.$ajax(that, 'get', that.$api.memberPriviledge, null, token, function(res){
                if(res.data['error_code'] == 0){
                    that.rights = res.data['msg'];
                }else{
                    that.toast(res.data['msg']);
                }
                loader.close();
            })
        }
    },
    mounted(){
        this.$store.state.tab = '会员特权';
        this.getRights();
    },
    activated(){
        this.$store.state.tab = '会员特权';
    }
}
</script>

<style lang='less'>
@rem:100rem;

.rights{
    width: 750/@rem;
    .rights-box{
        width: 100%;
        box-sizing: border-box;
        padding: 0 30/@rem;
        padding-bottom: 60/@rem;
        background: #ffffff;
        .rights-head{
            width: 100%;
            height: 88/@rem;
            display: flex;
            align-items: center;
            border-bottom: 3/@rem solid #efefef;
            img{
                height: 40/@rem;
                width: 40/@rem;
            } 
            span{
                font-size: 30/@rem;
                color: #444444;
                margin-left: 20/@rem;
            }
        }
        .des-head{
            text-align: start;
            margin-top: 32/@rem;
        }
        .rights-des{
            .des-detail{
                display: flex;
                margin-top: 30/@rem;
                .left{
                    width: 196/@rem;
                }
                .right{
                    display: flex;
                    flex-direction: column;
                }
            }
        }
    }
}
</style>
